package com.sdruixinggroup.mondayb2b.adapter;

import android.graphics.Color;
import android.view.View;
import android.widget.TextView;

import com.sdruixinggroup.mondayb2b.R;
import com.sdruixinggroup.mondayb2b.models.Province;

/**
 * Created by 00029935 on 2017/1/24.
 */

public class ProvinceAdapter extends QuickAdapter<Province.RegionsBean> {
    @Override
    public int getLayoutID(int viewType) {
        return R.layout.province_item;
    }

    @Override
    public void convert(VH holder, Province.RegionsBean itemData, int position) {
        TextView textView = (TextView)holder.getView(R.id.tv_province);
        textView.setText(itemData.getName());


        if(itemData.isSelector){
            holder.getView(R.id.view).setVisibility(View.VISIBLE);
//            holder.getView(R.id.line).setVisibility(View.INVISIBLE);
            textView.setTextColor(Color.BLACK);
        }else {
            holder.getView(R.id.view).setVisibility(View.INVISIBLE);
//            holder.getView(R.id.line).setVisibility(View.VISIBLE);
            textView.setTextColor(0xff999999);
        }

    }
}
